package com.base.library.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.RelativeLayout;

/**
 * Created by xiechengzhi on 2017/5/8.
 */

public class HeadInfoView extends RelativeLayout {
    private ShapedImageView user_head;

    public HeadInfoView(Context context) {
        super(context);
    }

    public HeadInfoView(Context context, AttributeSet attrs) {
        super(context, attrs);
        initView(context, attrs);
    }

    public HeadInfoView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        initView(context, attrs);
    }

    public HeadInfoView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
        initView(context, attrs);
    }

    public void initView(Context context, AttributeSet attrs) {
        if (!isInEditMode()) {
            LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          /*  View view = inflater.inflate(R.layout.head_info_view, this);
            user_head = (ShapedImageView) view.findViewById(R.id.user_head);*/
        }
    }

    public void setUserHead(String url) {
        com.base.library.manager.GlideImageManager.getInstance(getContext()).displayImageCircle(url, user_head);
    }


}
